package com.wangfei.test.filehandler.impl;

import com.wangfei.test.filehandler.access.IStringReplace;

import java.util.HashMap;

import static com.wangfei.test.filehandler.Type.*;

public class ReplacehandleStrategyFactory {
    private static HashMap<Integer, IStringReplace> map;

    static {
        map = new HashMap<Integer, IStringReplace>();
        map.put(DATENUMERIC.getIndex(), DateNumericStringReplace.init());
        map.put(DATE.getIndex(), DateCnStringReplace.init());
        map.put(NUMERIC.getIndex(), PorjectNoStringReplace.init());
        map.put(MOUDLE.getIndex(), MOUDLEStringReplace.init());
        map.put(IPADDRESS.getIndex(), IpAddressStringReplace.init());
    }

    public static IStringReplace getStrategy(Integer number){
        return map.get(number);
    }
}
